projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0bd5a96
)
emojicompletion: Avoid a memory overrun
author
Matthias Clasen
<mclasen@redhat.com>
Thu, 15 Oct 2020 19:16:06 +0000
(15:16 -0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Thu, 15 Oct 2020 20:32:55 +0000
(16:32 -0400)
Don't read beyond the beginning of the string.
Fixes: #3245
gtk/gtkemojicompletion.c
patch
|
blob
|
history
diff --git
a/gtk/gtkemojicompletion.c
b/gtk/gtkemojicompletion.c
index 712418850a017a22998ad16f06d98e107c2b881d..31669c85d5adcec9a77988dfaa8cd5f3dae65252 100644
(file)
--- a/
gtk/gtkemojicompletion.c
+++ b/
gtk/gtkemojicompletion.c
@@
-115,7
+115,8
@@
next:
break;
}
}
- while (g_unichar_isalnum (g_utf8_get_char (p)) || *p == '_' || *p == ' ');
+ while (p > text &&
+ (g_unichar_isalnum (g_utf8_get_char (p)) || *p == '_' || *p == ' '));
if (found_candidate)
n_matches = populate_completion (completion, p, 0);